home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1994
/
MacHack 1994.toast
/
MacHack™94
/
Talks & Papers
/
Timothy Knox
/
Pixie Scheme Folder
/
Pixie Scheme
/
Debugger.s
< prev
next >
Wrap
Text File
|
1994-06-24
|
1KB
|
44 lines
;; Simple debugger for Pixie Scheme. Not very useful.
; An environment list is a non–empty list whose last member
; is a vector, each of whose elements is in turn a list of symbols.
; All other members of the environment list are lists of symbols.
; The last member consists of all symbols that are bound at top–level.
; The first member consists of all symbols bound in the innermost
; lexical scope of the environment, the second member consists of all
; symbols bound in the next lexical scope, and so on.
(define (e::debug env-list)
(newline) (newline)
(display "Run–Time Stack:") (newline)
(display "==============") (newline)
(e::show-stack)
(display "Run–Time Stack (printed):") (newline)
(display "========================") (newline)
(e::write-stack) (newline) (newline)
(display "Dynamic Environments:") (newline)
(display "====================") (newline)
(e::show-envs env-list 0) (newline)
(e::reset))
(define (e::show-envs env-list n)
(if env-list
(begin
(if (not (vector? (car env-list)))
(e::show-env (car env-list) n))
(e::show-envs (cdr env-list) (+ n 1)))))
(define (e::show-env env n)
(display "-------- Environment ") (display n)
(display " of Environment List --------") (newline)
(e::show-env-1 env))
(define (e::show-env-1 env)
(if env
(begin
(display " ") (e::show-symbol (car env)) (newline)
(e::show-env-1 (cdr env)))))
(define (e::show-symbol s)
(display s))